<%@page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>外卖管理系统</title>
<link rel="stylesheet" href="/css/admin.css" type="text/css"/>
<script type="text/javascript" src="/js/jquery-1.6.1.min.js"></script>
</head>
<body leftmargin="2" topmargin="2">
<s:form id="create" action="admin_menu_type" onsubmit="VF_typeflag();return false;">
<s:hidden name="action" />
<s:hidden name="id" />
<s:hidden name="resId" />
 <fieldset><legend>
 <s:if test="%{action=='doadd'}">添加菜单分类方式</s:if>
 <s:if test="%{action=='doupdate'}">修改菜单分类方式</s:if>
 </legend>
 <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <COLGROUP>
  <COL width="100" />
  <COL width="*" />
    <tr class="tdbg2"> 
      <td align="right" >名称：</td>
      <td><s:textfield id="typeName" name="typeName" size="20"/></td>
    </tr>
    <tr class="tdbg2"> 
      <td align="right" >备注：</td>
      <td><s:textfield id="typeMemo" name="typeMemo" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">是否显示：</td>
      <td><s:select list="isShowList" name="isShow" id="isShow" listKey="key" listValue="value"></s:select></td>
    </tr>
	<tr class="tdbg3"> 
      <td align="right">排  序：</td>
      <td><s:textfield id="orderNum" name="orderNum" size="20"/></td>
    </tr>
     <tr class="tdbg3">
      <td colspan="2" align="center"><s:submit value="提交"/></td>
    </tr>
</table></fieldset>
</s:form>
<script type="text/javascript">
function VF_typeflag(){ 
    var errMsg = "";
	if ($('#typeName').val() == ""){
        errMsg = "请填写名称！";
    }
	if ($('#typeMemo').val() == ""){
        errMsg = "请填写备注！";
    }
	if ($('#isShow').val() == -1){
        errMsg = "请选择显示信息！";
    }
    if(isNaN($('#orderNum').val())){
		errMsg = "排序请添写数字！";
	}
    if (errMsg != ""){
        alert(errMsg);
    }else{
		document.getElementById('create').submit();
	}
}
</script>
</body>
</html>
